# NOTE:
# I am a fucker builder, I don't provide any safe PKGBUILD
# and I always install to /usr/local/bin/ 

# must define
pkgname=timecout
pkgrel=1
pkgver=0.0.1
pkgdesc="sdl2 timecount application"
arch=('x86_64') #this is an array
license=('MIT') #this is an array
sha512sums=('SKIP')
depends=('sdl2')

# NOTE: make sure this source is not dead
source=("https://gitee.com/nidielaila/mock-tsoding-timecount/releases/download/linux-timecount/timeout.tar.gz")

build() {
  #default in dir src
  echo "NOTE: +++++++++++++++++" ${PWD}
  # I not using $srcdir
  
  cd ..
  echo "NOTE: +++++++++++++++++" ${PWD}
  #rm -rf pkg src
  tar xvfz timeout.tar.gz
  mkdir bin
  make
  strip -S -s -x bin/timecount
}

package() {
  echo "NOTE: ++++++++++++++++++++=" ${srcdir}
  echo "NOTE: ++++++++++++++++++++=" ${pkgdir}

  echo "NOTE: +++++++++++++++++++++" ${PWD}
  cd ..

  sudo cp bin/timecount /usr/local/bin/timecount 
}
